/**
 * @fileOverview Html buttons plugin.
 */
VED.plugins.add( 'htmlbuttons', {
   init : function( editor ) {
      var buttonsConfig = editor.config.htmlbuttons;
      if (!buttonsConfig)
         return;

      function createCommand( definition ) {
         return {
            exec: function( editor ) {
               editor.insertHtml( definition.html );
            }
         };
      }

      // Create the command for each button
      for(var i=0; i<buttonsConfig.length; i++) {
         var button = buttonsConfig[ i ];
         var commandName = button.name;
         editor.addCommand( commandName, createCommand(button, editor) );

         editor.ui.addButton( commandName, {
            label : button.title,
            command : commandName,
            icon : this.path + button.icon
         });
      }
   } //Init

} );

/*
VED.config.htmlbuttons =  [
   {
      name:'button1',
      icon:'icon1.png',
      html:'<a href="http://www.google.com">Search something</a>',
      title:'A link to Google'
   },
   {
      name:'button2',
      icon:'icon2.png',
      html:'<table style="min-width:200px"><tr><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr></table>',
      title:'A simple table'
   },
   {
      name:'button3',
      icon:'icon3.png',
      html:'<ol><li>Item 1 <ol><li>Sub item 1</li><li>Sub item 2</li></ol></li></ol>',
      title:'A nested list'
   }
];
*/






